#include "GameOverLayer.h"
#include "GameMenu.h"
#include "Resources.h"
#include "VisibleRect.h"

GameOverLayer::GameOverLayer()
{

}

GameOverLayer::~GameOverLayer()
{

}

bool GameOverLayer::init()
{
	bool bRet = false;
	do 
	{
		CC_BREAK_IF(!BaseLayer::init());
		addBg(kBG1);
		CCRect rect = CCRectMake(210, 110, 180, 70);
		CCSprite *pSprite = CCSprite::create(s_screens1, rect);
		pSprite->setScale(2.0f);
		pSprite->setPosition(ccp(VisibleRect::center().x, VisibleRect::center().y + 150));
		addChild(pSprite);


		
		bRet = true;
	} while (false);
	return bRet;
}

void GameOverLayer::keyBackClicked()
{
	CCScene *pScene = CCTransitionFade::create(0.5f, GameMenu::scene());
	CCDirector::sharedDirector()->replaceScene(pScene);
}

void GameOverLayer::onBack(CCObject *pSender)
{
	REPLACE_SCENE(CCTransitionFade, 0.5f, GameMenu)
}